3.1.1 \(\int (a+b \csc ^2(c+d x))^4 \, dx\) [1]

3.1.1.1 Optimal result
3.1.1.2 Mathematica [A] (verified)
3.1.1.3 Rubi [A] (verified)
3.1.1.4 Maple [A] (verified)
3.1.1.5 Fricas [B] (verification not implemented)
3.1.1.6 Sympy [F]
3.1.1.7 Maxima [A] (verification not implemented)
3.1.1.8 Giac [B] (verification not implemented)
3.1.1.9 Mupad [B] (verification not implemented)

3.1.1.1 Optimal result

Integrand size = 14, antiderivative size = 112 \[ \int \left (a+b \csc ^2(c+d x)\right )^4 \, dx=a^4 x-\frac {b (2 a+b) \left (2 a^2+2 a b+b^2\right ) \cot (c+d x)}{d}-\frac {b^2 \left (6 a^2+8 a b+3 b^2\right ) \cot ^3(c+d x)}{3 d}-\frac {b^3 (4 a+3 b) \cot ^5(c+d x)}{5 d}-\frac {b^4 \cot ^7(c+d x)}{7 d} \]

output
a^4*x-b*(2*a+b)*(2*a^2+2*a*b+b^2)*cot(d*x+c)/d-1/3*b^2*(6*a^2+8*a*b+3*b^2) 
*cot(d*x+c)^3/d-1/5*b^3*(4*a+3*b)*cot(d*x+c)^5/d-1/7*b^4*cot(d*x+c)^7/d
 
3.1.1.2 Mathematica [A] (verified)

Time = 4.39 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.32 \[ \int \left (a+b \csc ^2(c+d x)\right )^4 \, dx=-\frac {16 \left (a+b \csc ^2(c+d x)\right )^4 \left (-105 a^4 (c+d x)+b \cot (c+d x) \left (420 a^3+420 a^2 b+224 a b^2+48 b^3+2 b \left (105 a^2+56 a b+12 b^2\right ) \csc ^2(c+d x)+6 b^2 (14 a+3 b) \csc ^4(c+d x)+15 b^3 \csc ^6(c+d x)\right )\right ) \sin ^8(c+d x)}{105 d (a+2 b-a \cos (2 (c+d x)))^4} \]

input
Integrate[(a + b*Csc[c + d*x]^2)^4,x]
 
output
(-16*(a + b*Csc[c + d*x]^2)^4*(-105*a^4*(c + d*x) + b*Cot[c + d*x]*(420*a^ 
3 + 420*a^2*b + 224*a*b^2 + 48*b^3 + 2*b*(105*a^2 + 56*a*b + 12*b^2)*Csc[c 
 + d*x]^2 + 6*b^2*(14*a + 3*b)*Csc[c + d*x]^4 + 15*b^3*Csc[c + d*x]^6))*Si 
n[c + d*x]^8)/(105*d*(a + 2*b - a*Cos[2*(c + d*x)])^4)
 
3.1.1.3 Rubi [A] (verified)

Time = 0.27 (sec) , antiderivative size = 110, normalized size of antiderivative = 0.98, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 4616, 300, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \left (a+b \csc ^2(c+d x)\right )^4 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \left (a+b \sec \left (c+d x+\frac {\pi }{2}\right )^2\right )^4dx\)

\(\Big \downarrow \) 4616

\(\displaystyle -\frac {\int \frac {\left (b \cot ^2(c+d x)+a+b\right )^4}{\cot ^2(c+d x)+1}d\cot (c+d x)}{d}\)

\(\Big \downarrow \) 300

\(\displaystyle -\frac {\int \left (b^4 \cot ^6(c+d x)+b^3 (4 a+3 b) \cot ^4(c+d x)+b^2 \left (6 a^2+8 b a+3 b^2\right ) \cot ^2(c+d x)+b (2 a+b) \left (2 a^2+2 b a+b^2\right )+\frac {a^4}{\cot ^2(c+d x)+1}\right )d\cot (c+d x)}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {a^4 \arctan (\cot (c+d x))+\frac {1}{3} b^2 \left (6 a^2+8 a b+3 b^2\right ) \cot ^3(c+d x)+b (2 a+b) \left (2 a^2+2 a b+b^2\right ) \cot (c+d x)+\frac {1}{5} b^3 (4 a+3 b) \cot ^5(c+d x)+\frac {1}{7} b^4 \cot ^7(c+d x)}{d}\)

input
Int[(a + b*Csc[c + d*x]^2)^4,x]
 
output
-((a^4*ArcTan[Cot[c + d*x]] + b*(2*a + b)*(2*a^2 + 2*a*b + b^2)*Cot[c + d* 
x] + (b^2*(6*a^2 + 8*a*b + 3*b^2)*Cot[c + d*x]^3)/3 + (b^3*(4*a + 3*b)*Cot 
[c + d*x]^5)/5 + (b^4*Cot[c + d*x]^7)/7)/d)
 

3.1.1.3.1 Defintions of rubi rules used

rule 300
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Int 
[PolynomialDivide[(a + b*x^2)^p, (c + d*x^2)^(-q), x], x] /; FreeQ[{a, b, c 
, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && ILtQ[q, 0] && GeQ[p, -q]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4616
Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> With[{ff = 
FreeFactors[Tan[e + f*x], x]}, Simp[ff/f   Subst[Int[(a + b + b*ff^2*x^2)^p 
/(1 + ff^2*x^2), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] 
&& NeQ[a + b, 0] && NeQ[p, -1]
 
3.1.1.4 Maple [A] (verified)

Time = 2.12 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.15

method result size
derivativedivides \(\frac {a^{4} \left (d x +c \right )-4 a^{3} b \cot \left (d x +c \right )+6 a^{2} b^{2} \left (-\frac {2}{3}-\frac {\csc \left (d x +c \right )^{2}}{3}\right ) \cot \left (d x +c \right )+4 a \,b^{3} \left (-\frac {8}{15}-\frac {\csc \left (d x +c \right )^{4}}{5}-\frac {4 \csc \left (d x +c \right )^{2}}{15}\right ) \cot \left (d x +c \right )+b^{4} \left (-\frac {16}{35}-\frac {\csc \left (d x +c \right )^{6}}{7}-\frac {6 \csc \left (d x +c \right )^{4}}{35}-\frac {8 \csc \left (d x +c \right )^{2}}{35}\right ) \cot \left (d x +c \right )}{d}\) \(129\)
default \(\frac {a^{4} \left (d x +c \right )-4 a^{3} b \cot \left (d x +c \right )+6 a^{2} b^{2} \left (-\frac {2}{3}-\frac {\csc \left (d x +c \right )^{2}}{3}\right ) \cot \left (d x +c \right )+4 a \,b^{3} \left (-\frac {8}{15}-\frac {\csc \left (d x +c \right )^{4}}{5}-\frac {4 \csc \left (d x +c \right )^{2}}{15}\right ) \cot \left (d x +c \right )+b^{4} \left (-\frac {16}{35}-\frac {\csc \left (d x +c \right )^{6}}{7}-\frac {6 \csc \left (d x +c \right )^{4}}{35}-\frac {8 \csc \left (d x +c \right )^{2}}{35}\right ) \cot \left (d x +c \right )}{d}\) \(129\)
parts \(a^{4} x +\frac {b^{4} \left (-\frac {16}{35}-\frac {\csc \left (d x +c \right )^{6}}{7}-\frac {6 \csc \left (d x +c \right )^{4}}{35}-\frac {8 \csc \left (d x +c \right )^{2}}{35}\right ) \cot \left (d x +c \right )}{d}-\frac {4 a^{3} b \cot \left (d x +c \right )}{d}+\frac {6 a^{2} b^{2} \left (-\frac {2}{3}-\frac {\csc \left (d x +c \right )^{2}}{3}\right ) \cot \left (d x +c \right )}{d}+\frac {4 a \,b^{3} \left (-\frac {8}{15}-\frac {\csc \left (d x +c \right )^{4}}{5}-\frac {4 \csc \left (d x +c \right )^{2}}{15}\right ) \cot \left (d x +c \right )}{d}\) \(133\)
parallelrisch \(\frac {-15 \cot \left (\frac {d x}{2}+\frac {c}{2}\right )^{7} b^{4}-336 b^{3} \left (a +\frac {7 b}{16}\right ) \cot \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}+\left (-3360 a^{2} b^{2}-2800 a \,b^{3}-735 b^{4}\right ) \cot \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+\left (-26880 a^{3} b -30240 a^{2} b^{2}-16800 a \,b^{3}-3675 b^{4}\right ) \cot \left (\frac {d x}{2}+\frac {c}{2}\right )+15 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7} b^{4}+336 b^{3} \left (a +\frac {7 b}{16}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}+\left (3360 a^{2} b^{2}+2800 a \,b^{3}+735 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+\left (26880 a^{3} b +30240 a^{2} b^{2}+16800 a \,b^{3}+3675 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+13440 a^{4} x d}{13440 d}\) \(224\)
norman \(\frac {a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}-\frac {b^{4}}{896 d}+\frac {b^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{14}}{896 d}-\frac {b \left (256 a^{3}+288 a^{2} b +160 a \,b^{2}+35 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{128 d}+\frac {b \left (256 a^{3}+288 a^{2} b +160 a \,b^{2}+35 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{128 d}-\frac {b^{2} \left (96 a^{2}+80 a b +21 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{384 d}+\frac {b^{2} \left (96 a^{2}+80 a b +21 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}}{384 d}-\frac {b^{3} \left (16 a +7 b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{640 d}+\frac {b^{3} \left (16 a +7 b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}}{640 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}\) \(257\)
risch \(a^{4} x -\frac {8 i b \left (105 a^{3} {\mathrm e}^{12 i \left (d x +c \right )}-630 a^{3} {\mathrm e}^{10 i \left (d x +c \right )}-315 a^{2} b \,{\mathrm e}^{10 i \left (d x +c \right )}+1575 a^{3} {\mathrm e}^{8 i \left (d x +c \right )}+1365 a^{2} b \,{\mathrm e}^{8 i \left (d x +c \right )}+560 a \,b^{2} {\mathrm e}^{8 i \left (d x +c \right )}-2100 a^{3} {\mathrm e}^{6 i \left (d x +c \right )}-2310 a^{2} b \,{\mathrm e}^{6 i \left (d x +c \right )}-1400 a \,b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-420 b^{3} {\mathrm e}^{6 i \left (d x +c \right )}+1575 a^{3} {\mathrm e}^{4 i \left (d x +c \right )}+1890 a^{2} b \,{\mathrm e}^{4 i \left (d x +c \right )}+1176 a \,b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+252 b^{3} {\mathrm e}^{4 i \left (d x +c \right )}-630 a^{3} {\mathrm e}^{2 i \left (d x +c \right )}-735 a^{2} b \,{\mathrm e}^{2 i \left (d x +c \right )}-392 a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-84 b^{3} {\mathrm e}^{2 i \left (d x +c \right )}+105 a^{3}+105 a^{2} b +56 a \,b^{2}+12 b^{3}\right )}{105 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{7}}\) \(311\)

input
int((a+b*csc(d*x+c)^2)^4,x,method=_RETURNVERBOSE)
 
output
1/d*(a^4*(d*x+c)-4*a^3*b*cot(d*x+c)+6*a^2*b^2*(-2/3-1/3*csc(d*x+c)^2)*cot( 
d*x+c)+4*a*b^3*(-8/15-1/5*csc(d*x+c)^4-4/15*csc(d*x+c)^2)*cot(d*x+c)+b^4*( 
-16/35-1/7*csc(d*x+c)^6-6/35*csc(d*x+c)^4-8/35*csc(d*x+c)^2)*cot(d*x+c))
 
3.1.1.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 249 vs. \(2 (106) = 212\).

Time = 0.27 (sec) , antiderivative size = 249, normalized size of antiderivative = 2.22 \[ \int \left (a+b \csc ^2(c+d x)\right )^4 \, dx=-\frac {4 \, {\left (105 \, a^{3} b + 105 \, a^{2} b^{2} + 56 \, a b^{3} + 12 \, b^{4}\right )} \cos \left (d x + c\right )^{7} - 14 \, {\left (90 \, a^{3} b + 105 \, a^{2} b^{2} + 56 \, a b^{3} + 12 \, b^{4}\right )} \cos \left (d x + c\right )^{5} + 70 \, {\left (18 \, a^{3} b + 24 \, a^{2} b^{2} + 14 \, a b^{3} + 3 \, b^{4}\right )} \cos \left (d x + c\right )^{3} - 105 \, {\left (4 \, a^{3} b + 6 \, a^{2} b^{2} + 4 \, a b^{3} + b^{4}\right )} \cos \left (d x + c\right ) - 105 \, {\left (a^{4} d x \cos \left (d x + c\right )^{6} - 3 \, a^{4} d x \cos \left (d x + c\right )^{4} + 3 \, a^{4} d x \cos \left (d x + c\right )^{2} - a^{4} d x\right )} \sin \left (d x + c\right )}{105 \, {\left (d \cos \left (d x + c\right )^{6} - 3 \, d \cos \left (d x + c\right )^{4} + 3 \, d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \]

input
integrate((a+b*csc(d*x+c)^2)^4,x, algorithm="fricas")
 
output
-1/105*(4*(105*a^3*b + 105*a^2*b^2 + 56*a*b^3 + 12*b^4)*cos(d*x + c)^7 - 1 
4*(90*a^3*b + 105*a^2*b^2 + 56*a*b^3 + 12*b^4)*cos(d*x + c)^5 + 70*(18*a^3 
*b + 24*a^2*b^2 + 14*a*b^3 + 3*b^4)*cos(d*x + c)^3 - 105*(4*a^3*b + 6*a^2* 
b^2 + 4*a*b^3 + b^4)*cos(d*x + c) - 105*(a^4*d*x*cos(d*x + c)^6 - 3*a^4*d* 
x*cos(d*x + c)^4 + 3*a^4*d*x*cos(d*x + c)^2 - a^4*d*x)*sin(d*x + c))/((d*c 
os(d*x + c)^6 - 3*d*cos(d*x + c)^4 + 3*d*cos(d*x + c)^2 - d)*sin(d*x + c))
 
3.1.1.6 Sympy [F]

\[ \int \left (a+b \csc ^2(c+d x)\right )^4 \, dx=\int \left (a + b \csc ^{2}{\left (c + d x \right )}\right )^{4}\, dx \]

input
integrate((a+b*csc(d*x+c)**2)**4,x)
 
output
Integral((a + b*csc(c + d*x)**2)**4, x)
 
3.1.1.7 Maxima [A] (verification not implemented)

Time = 0.25 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.26 \[ \int \left (a+b \csc ^2(c+d x)\right )^4 \, dx=a^{4} x - \frac {4 \, a^{3} b}{d \tan \left (d x + c\right )} - \frac {2 \, {\left (3 \, \tan \left (d x + c\right )^{2} + 1\right )} a^{2} b^{2}}{d \tan \left (d x + c\right )^{3}} - \frac {4 \, {\left (15 \, \tan \left (d x + c\right )^{4} + 10 \, \tan \left (d x + c\right )^{2} + 3\right )} a b^{3}}{15 \, d \tan \left (d x + c\right )^{5}} - \frac {{\left (35 \, \tan \left (d x + c\right )^{6} + 35 \, \tan \left (d x + c\right )^{4} + 21 \, \tan \left (d x + c\right )^{2} + 5\right )} b^{4}}{35 \, d \tan \left (d x + c\right )^{7}} \]

input
integrate((a+b*csc(d*x+c)^2)^4,x, algorithm="maxima")
 
output
a^4*x - 4*a^3*b/(d*tan(d*x + c)) - 2*(3*tan(d*x + c)^2 + 1)*a^2*b^2/(d*tan 
(d*x + c)^3) - 4/15*(15*tan(d*x + c)^4 + 10*tan(d*x + c)^2 + 3)*a*b^3/(d*t 
an(d*x + c)^5) - 1/35*(35*tan(d*x + c)^6 + 35*tan(d*x + c)^4 + 21*tan(d*x 
+ c)^2 + 5)*b^4/(d*tan(d*x + c)^7)
 
3.1.1.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 351 vs. \(2 (106) = 212\).

Time = 0.30 (sec) , antiderivative size = 351, normalized size of antiderivative = 3.13 \[ \int \left (a+b \csc ^2(c+d x)\right )^4 \, dx=\frac {15 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 336 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 147 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3360 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2800 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 735 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 13440 \, {\left (d x + c\right )} a^{4} + 26880 \, a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 30240 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 16800 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3675 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {26880 \, a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 30240 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 16800 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 3675 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 3360 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 2800 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 735 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 336 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 147 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 15 \, b^{4}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7}}}{13440 \, d} \]

input
integrate((a+b*csc(d*x+c)^2)^4,x, algorithm="giac")
 
output
1/13440*(15*b^4*tan(1/2*d*x + 1/2*c)^7 + 336*a*b^3*tan(1/2*d*x + 1/2*c)^5 
+ 147*b^4*tan(1/2*d*x + 1/2*c)^5 + 3360*a^2*b^2*tan(1/2*d*x + 1/2*c)^3 + 2 
800*a*b^3*tan(1/2*d*x + 1/2*c)^3 + 735*b^4*tan(1/2*d*x + 1/2*c)^3 + 13440* 
(d*x + c)*a^4 + 26880*a^3*b*tan(1/2*d*x + 1/2*c) + 30240*a^2*b^2*tan(1/2*d 
*x + 1/2*c) + 16800*a*b^3*tan(1/2*d*x + 1/2*c) + 3675*b^4*tan(1/2*d*x + 1/ 
2*c) - (26880*a^3*b*tan(1/2*d*x + 1/2*c)^6 + 30240*a^2*b^2*tan(1/2*d*x + 1 
/2*c)^6 + 16800*a*b^3*tan(1/2*d*x + 1/2*c)^6 + 3675*b^4*tan(1/2*d*x + 1/2* 
c)^6 + 3360*a^2*b^2*tan(1/2*d*x + 1/2*c)^4 + 2800*a*b^3*tan(1/2*d*x + 1/2* 
c)^4 + 735*b^4*tan(1/2*d*x + 1/2*c)^4 + 336*a*b^3*tan(1/2*d*x + 1/2*c)^2 + 
 147*b^4*tan(1/2*d*x + 1/2*c)^2 + 15*b^4)/tan(1/2*d*x + 1/2*c)^7)/d
 
3.1.1.9 Mupad [B] (verification not implemented)

Time = 20.92 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.95 \[ \int \left (a+b \csc ^2(c+d x)\right )^4 \, dx=a^4\,x-\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (\frac {3\,b^4}{5}+\frac {4\,a\,b^3}{5}\right )+{\mathrm {tan}\left (c+d\,x\right )}^6\,\left (4\,a^3\,b+6\,a^2\,b^2+4\,a\,b^3+b^4\right )+{\mathrm {tan}\left (c+d\,x\right )}^4\,\left (2\,a^2\,b^2+\frac {8\,a\,b^3}{3}+b^4\right )+\frac {b^4}{7}}{d\,{\mathrm {tan}\left (c+d\,x\right )}^7} \]

input
int((a + b/sin(c + d*x)^2)^4,x)
 
output
a^4*x - (tan(c + d*x)^2*((4*a*b^3)/5 + (3*b^4)/5) + tan(c + d*x)^6*(4*a*b^ 
3 + 4*a^3*b + b^4 + 6*a^2*b^2) + tan(c + d*x)^4*((8*a*b^3)/3 + b^4 + 2*a^2 
*b^2) + b^4/7)/(d*tan(c + d*x)^7)